package com.kehutong.repair.app;

import com.kehutong.repair.service.admin.AdminRepairsTypeService;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.mvc.http.result.Result;

@MvcAction
@ReqMapping("/kht-bin/repairs/type")
public class RepairsTypeAction {

    @Inject
    private AdminRepairsTypeService adminRepairsTypeService;

    @ReqMapping("/list")
    public Object list(JSONObject jsonObject) {
        return Result.success(adminRepairsTypeService.allList(jsonObject));
    }

    @ReqMapping("/get")
    public Object get(JSONObject jsonObject) {
        return Result.success(adminRepairsTypeService.get(jsonObject.getString("id")));
    }
}
